﻿using System;
using System.Collections.Generic;

namespace Trentacular.Office.Server.Search.FacetedSearch
{
    /// <summary>
    /// Represents the group of generated facets.
    /// </summary>
    public class FacetGroup
    {
        /// <summary>
        /// Gets the configuration ID of the <see cref="FacetProviderConfiguration" />
        /// used to create the facets for this group.
        /// </summary>
        /// <value>The configuration ID.</value>
        public Guid ConfigurationID { get; private set; }

        /// <summary>
        /// Gets the display name of the facet group.
        /// </summary>
        /// <value>The display name of the facet group.</value>
        public string DisplayName { get; private set; }

        /// <summary>
        /// Gets the facets for the facet group.
        /// </summary>
        /// <value>The facets for the facet group.</value>
        public IList<Facet> Facets { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="FacetGroup"/> class.
        /// </summary>
        /// <param name="configuration">The facet provider configuration.</param>
        /// <param name="facets">The generated facets.</param>
        public FacetGroup(
            FacetProviderConfiguration configuration,
            IList<Facet> facets)
        {
            this.ConfigurationID = configuration.ID;
            this.DisplayName = configuration.DisplayName;
            this.Facets = facets;
        }
    }
}
